home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Spiele & Edutainment / BMAPEdit ƒ / BMAPEdit 3.0 / BMAPEdit 3.0.rsrc / PREC_103 < prev    next >
Text File  |  1996-01-31  |  2KB  |  89 lines

  1. /BMAPEditdict 250 dict def
  2. BMAPEditdict begin
  3.  
  4. /drawcolorBMAPterrain
  5. { % stack: T, L, W
  6.  /W exch def
  7.  /L exch def
  8.  /T exch def
  9.  /pts_per_sqr W map_W div 8 mul def
  10.  /idx 0 def
  11.  [/Indexed /DeviceRGB 15
  12.   <FFFFFF 000000 00FFFF 00FF00 008000 FFFF00 FF6402 FF0000
  13.    0000FF A4A4A4 6D6D6D 373737 C1A56B 815A47 562C05 402323>] setcolorspace
  14.  gsave
  15.  .2 setlinewidth 1 setlinecap 1 setlinejoin
  16.  W W scale
  17.  L W div T W div translate
  18.  /ImageType 1 def
  19.  /Width map_W def
  20.  /Height map_W def
  21.  /ImageMatrix [map_W 0 0 map_W 0 0] def
  22.  /DataSource { terrain idx get /idx idx 1 add def } def
  23.  /BitsPerComponent 4 def
  24.  /Decode [15 0] def
  25.  BMAPEditdict image
  26.  grestore
  27.  /DeviceGray setcolorspace
  28.  gsave
  29.  L T translate
  30.  0 0 moveto W 0 rlineto 0 W rlineto -1 W mul 0 rlineto
  31.  closepath 0 setgray stroke
  32.  grestore
  33. } def
  34.  
  35. /drawBMAPterrain
  36. { % stack: T, L, W
  37.  /W exch def
  38.  /L exch def
  39.  /T exch def
  40.  /pts_per_sqr W map_W div 8 mul def
  41.  /idx 0 def
  42.  gsave
  43.  .2 setlinewidth 1 setlinecap 1 setlinejoin
  44.  W W scale
  45.  L W div T W div translate
  46.  map_W map_W 1 [map_W 0 0 map_W 0 0] { terrain idx get /idx idx 1 add def } image
  47.  grestore
  48.  gsave
  49.  L T translate
  50.  0 0 moveto W 0 rlineto 0 W rlineto -1 W mul 0 rlineto
  51.  closepath 0 setgray stroke
  52.  grestore
  53. } def
  54.  
  55. /draw_PB_range
  56. { % stack: x, y
  57.  /y exch map_T sub def
  58.  /x exch map_L sub def
  59.  gsave
  60.  L T translate
  61.  x pts_per_sqr mul pts_per_sqr 2 div add
  62.  y pts_per_sqr mul pts_per_sqr 2 div add
  63.  translate
  64.  newpath 0 0 pts_per_sqr 7.5 mul 0 360 arc
  65.  .2 setlinewidth 1 setgray gsave stroke grestore
  66.  [ pts_per_sqr pts_per_sqr ] 0 setdash 0 setgray stroke
  67.  grestore
  68. } def
  69.  
  70. /show_title
  71. { % stack: x, y, title
  72.  /title exch def
  73.  gsave
  74.  translate
  75.  title stringwidth pop -2 div 0 moveto 1 -1 scale title show
  76.  grestore
  77. } def
  78.  
  79. /show_info
  80. { % stack: x, y, title
  81.  /title exch def
  82.  moveto
  83.  gsave
  84.  1 -1 scale title show
  85.  grestore
  86. } def
  87.  
  88. end
  89.